package com.winchain.chainbill.chain.callback.service.impl;

import com.shell.bee.acct.transaction.po.AcctTxRec;
import com.shell.bee.base.utils.SystemUtil;
import com.shell.bee.base.utils.SystemUtil.SystemMode;
import com.winchain.chainbill.ChainBillUtil;
import com.winchain.chainbill.chain.ChainCallbackService;
import com.winchain.chainbill.chain.callback.service.SyncConfirmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("syncConfirmService")
public class SyncConfirmServiceImpl implements SyncConfirmService {
	@Autowired
	private ChainCallbackService chainCallbackService;

	public void confirm(AcctTxRec AcctTxRec, String txSnHost) {
		if ((SystemUtil.SystemMode.dev.equals(SystemUtil.getSystemMode())) || (!ChainBillUtil.onChain())) {
			this.chainCallbackService.callback(AcctTxRec, txSnHost);
		}
	}
}
